package com.example.base.sqllite;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class MySQLite extends SQLiteOpenHelper {
  private static final String DB_NAME = "user.db";
  private static final int VERSION = 1;

  public MySQLite(Context context, String name, SQLiteDatabase.CursorFactory factory, int version) {
    super(context, name, factory, version);
  }

  public MySQLite(Context context) {
    super(context, DB_NAME, null, VERSION);
  }

  @Override
  public void onCreate(SQLiteDatabase db) {
    db.execSQL("create table history(id integer primary key autoincrement, title varchar(20), text varchar(200),link varchar(50),time varchar(50))");
  }

  @Override
  public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

  }

  @Override
  public void onOpen(SQLiteDatabase db) {
    super.onOpen(db);
  }
}
